import { createSlice } from "@reduxjs/toolkit";

const cityStore = createSlice({
    name: "city-store",
    initialState: {
        cityName: "重庆"
    },
    reducers: {
        setCityName(state, action) {
            state.cityName = action.payload.cityName
        }
    }
})

//导出动作生成器
export const { setCityName } = cityStore.actions
export default cityStore.reducer